from socket import *

s = socket(AF_INET, SOCK_DGRAM)

addr = ("127.0.0.1",8888)

while True:
    data = input("请输入要发送的数据：")
    s.sendto(data.encode(), addr)
    if data == "over":
        print("聊天结束！")
        break

s.close()